$OpenBSD: patch-lto-plugin_Makefile_in,v 1.1.1.1 2016/09/04 16:20:19 pascal Exp $
--- lto-plugin/Makefile.in.orig	Wed May 13 13:30:22 2015
+++ lto-plugin/Makefile.in	Tue Aug 23 17:21:56 2016
@@ -263,11 +263,13 @@ AM_LIBTOOLFLAGS = --tag=disable-static
 libexecsub_LTLIBRARIES = liblto_plugin.la
 in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
 liblto_plugin_la_SOURCES = lto-plugin.c
+include $(top_srcdir)/../libversions
 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
 liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(lt_host_flags) -module \
 	-bindir $(libexecsubdir) $(if $(wildcard \
 	$(libiberty_noasan)),, $(if $(wildcard \
-	$(libiberty_pic)),,-Wc,$(libiberty)))
+	$(libiberty_pic)),,-Wc,$(libiberty))) \
+	$(LIBlto_plugin_LTVERSION)
 # Can be simplified when libiberty becomes a normal convenience library.
 libiberty = $(with_libiberty)/libiberty.a
 libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
@@ -586,7 +588,7 @@ $(in_gcc_libs) : $(gcc_build_dir)/%: %
 	  echo WARNING: $* is static, not copying to $@ >&2 ; \
 	else \
 	  $(mkinstalldirs) $(gcc_build_dir) && \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \
+	cp $* `pwd`/$@ ; \
 	fi
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
